{#查询图书页面#}

{% extends "index.html" %}
{% block head %}
    <link rel="stylesheet" type="text/css" href="{{ url_for('static',filename='css/style.css') }}">
    <style type="text/css">
        a {
            color: #007bff;
            text-decoration: none;
            background-color: transparent
        }

        a:hover {
            color: #0056b3;
            text-decoration: underline
        }

        a:not([href]):not([class]) {
            color: inherit;
            text-decoration: none
        }

        a:not([href]):not([class]):hover {
            color: inherit;
            text-decoration: none
        }

    </style>
    <script>
        function delete_borrower(name) {
            location.href = '/delete_borrower?name=' + name
        }

        function update_borrower(name,password,phone,email) {

            location.href = '/update_borrower?name=' + name+'&password='+password+'&phone='+phone+'&email='+email
        }

    </script>
{% endblock %}
{% block result %}
    {% if results %}
        <table class="qgg-table">
            <tr>
                <th>借阅者姓名</th>
                <th>借阅者密码</th>
                <th>借阅者电话</th>
                <th>借阅者邮箱</th>
                <th>操作</th>

            </tr>
            {% for rs in results %}
                <tr>
                    <td>{{ rs.name }}</td>
                    <td>{{ rs.password }}</td>
                    <td>{{ rs.phone }}</td>
                    <td>{{ rs.email }}</td>
                    <td>
                        <a href="javascript:;" onclick="update_borrower('{{ rs.name }}','{{ rs.password }}','{{ rs.phone }}','{{ rs.email }}')">修改</a>
                        <a href="javascript:;" onclick="delete_borrower('{{ rs.name }}')">删除</a>
                    </td>


                </tr>
            {% endfor %}
        {% for message in get_flashed_messages() %}
            <div class="form-group">
                <div class="text-danger">{{ message }}</div>
            </div>
        {% endfor %}

        </table>


    {% endif %}



{% endblock %}


